function XHR(url,method,data) {
	if(!url) {
		throw 'URL is undefined';
	}
	this.url = url;
	this.method = method || 'GET';
	this.xhr = Ti.Network.createHTTPClient();
	this.toolActInd = Titanium.UI.createActivityIndicator({
		message: 'Loading'
	});
}
XHR.prototype.getText = function(callback){
	var t = this.toolActInd;
	this.xhr.onload = function() {
		t.show();
		callback(this.responseText);
		t.hide();
	}
	this.xhr.open(this.method,this.url);
	this.xhr.send();
}
XHR.prototype.getXML = function(callback) {
	var t = this.toolActInd;
	this.xhr.onload = function() {
		t.show();
		callback(this.responseXML);
		t.hide();
	}
	this.xhr.open(this.method,this.url);
	this.xhr.send();
}
